package com.ap.core.validation.rules;

import org.apache.commons.lang.StringUtils;

import java.net.URI;

/**
 * Abstract implementation for the ValidationRule.
 *
 * @param <V>
 *            info object type to be validated
 */
public abstract class AbstractValidationRule<V> implements ValidationRule<V> {

    /** business rule id * */
    private String errorCode;



    /**
     * Default implementation for returning the URI for the rule e.g.
     * urn:<packageName.ClassName>
     *
     * @return the {@link java.net.URI} for the rule
     */
    public URI getUri() {
        return URI.create(StringUtils.replaceChars(getClass().getName(), ".", ":"));
    }

   

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
    
    public void onFailureAction(V infoObject){
    	
    }

    
}